using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace IronCow.UnitTests.Mock
{
    public class MockUserSettingsResponsePart : MockResponsePart
    {
        private string mTimeZone;
        private DateFormat mDateFormat;
        private TimeFormat mTimeFormat;

        public MockUserSettingsResponsePart()
            : this("Australia/Sydney", DateFormat.Default, TimeFormat.Default)
        {
        }

        public MockUserSettingsResponsePart(string timeZone, DateFormat dateFormat, TimeFormat timeFormat)
        {
            mTimeZone = timeZone;
            mDateFormat = dateFormat;
            mTimeFormat = timeFormat;
        }

        public override void GetResponseMarkup(System.Xml.XmlWriter markupWriter, Dictionary<string, string> parameters)
        {
            markupWriter.WriteStartElement("settings");
            {
                markupWriter.WriteElementString("timezone", mTimeZone);
                markupWriter.WriteElementString("dateformat", (mDateFormat == DateFormat.European) ? "0" : "1");
                markupWriter.WriteElementString("timeformat", (mTimeFormat == TimeFormat.TwelveHours) ? "0" : "1");
                markupWriter.WriteElementString("defaultlist", "123456");
            }
            markupWriter.WriteEndElement();
        }
    }
}
